package edu.nju.desserthouse.action.business;

import java.io.Serializable;
import java.util.ArrayList;

import nju.edu.desserthouse.model.Clerk;

public class ClerkInfoBean implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private ArrayList<Clerk> clerks = new ArrayList<Clerk>();
	
	public long getClerkID(int i){
		return clerks.get(i-1).getId();
	}
	
	public String getClerkName(int i){
		return clerks.get(i-1).getName();
	}
	
	public int getClerkBelong(int i){
		return clerks.get(i-1).getBelong();
	}
	
	public String getClerkPosition(int i){
		int privilege = clerks.get(i-1).getPrivilege();
		if(privilege == 0){
			return "Technician";
		}else if(privilege == 1){
			return "Salesman";
		}else if(privilege == 2){
			return "Manager";
		}else{
			return "Unknown";
		}
	}
	
	public int getListSize(){
		return clerks.size();
	}
	public void setClerkList(ArrayList<Clerk> clerks){
		this.clerks = clerks;
	}
}
